<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!--容器-->
    <div id="app">
        <div v-html="msg">
        </div>
        <div>
            <button @click="fn(-1)">减1</button>
            <span>{{count}}</span>
            <button @click="fn(+1)">加1</button>
        </div>
        <div>
            <p>我的名字：{{name}}</p>

        </div>

    </div>


</body>

<script src="../vue.js"></script>
<script>
    //1.创建Vue实例
    var app = new Vue({
        el: "#app",
        data: {
            msg: "<a href='http://baidu.com'>百度一下</a>",
            count: 0,
            name: "张三"

        },
        methods: {

            fn(a) {
                this.count = this.count + a;
            }
        },
        computed: {

            getName() {
                return this.name
            }

        },

        mounted() {
            console.log(this)
        },
    })




</script>

</html>